#configure board       hu_arm_v4
#configure clcd_lines  2
#configure memory      rom
#configure baudrate    38400



#define DISP_ROWS	2
#define	DISP_COLS	16

#include "pRTOS.h"
#include "HeartBeatController.h"
#include "HeartBeatDetection.h"
#include "InfraredSensor.h"
#include "EventDetection.h"
#include "Button.h"
#include "DisplayMonitor.h"

#include "MonitorController.h"


void uart0_write(char c) { 
	mkt_uart_char_write(UART0,c); 
}

int main(void) {
              
	mkt_uart_init(UART0, mkt_baudrate);
    mkt_print_vector = uart0_write;
    mkt_user_error_vector = mkt_default_error_handler;
    
     
    
    InfraredSensor theInfraredSensor;
    Button theSetButton;
    theSetButton.setButton(mkt_key_c);
    Button theModeButton;
    theModeButton.setButton(mkt_key_d);
    
   	DisplayMonitor theDisplayMonitor;
   	SpeakerSwitch theSpeakerSwitch; 
   
    HeartBeatDetection theHeartBeatDetection(&theInfraredSensor);
    EventDetection theEventDetection(&theSetButton,&theModeButton ); 
    
   
    HeartBeatController theHeartBeatController(&theInfraredSensor);   
    MonitorController theMonitorController(&theSetButton,&theModeButton,&theDisplayMonitor, &theHeartBeatController);
     
       
 
	pRTOS::run();

}

